//
//  MTFoucsCell.m
//  met
//
//  Created by 李晓俊 on 2019/5/11.
//  Copyright © 2019 李晓俊. All rights reserved.
//

#import "MTFoucsCell.h"

@implementation MTFoucsCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
+(MTFoucsCell *)cellWithTableView:(UITableView *)tableview{
    static NSString* ID =  @"MTFoucsCell";
    MTFoucsCell* cell = [tableview dequeueReusableCellWithIdentifier:ID];
    if (cell == nil) {
        cell = [[[NSBundle mainBundle] loadNibNamed:NSStringFromClass(self) owner:nil options:nil] lastObject];
    }
    cell.selectionStyle = UITableViewCellSelectionStyleNone;
    //    cell.backgroundColor = [UIColor clearColor];
    
    return cell;
}
- (IBAction)addClick:(id)sender {
    if (self.addBtnClick) {
        self.addBtnClick(self.model.friendsId);
    }
}

- (void)setModel:(FoucsModel *)model {
    _model = model;
    [self.headImage sd_setImageWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",model.portraitMap]] placeholderImage:[UIImage imageNamed:@"男（未选中）"]];
    self.name.text = [NSString stringWithFormat:@"%@",model.nickName];
    self.time.text = [NSString stringWithFormat:@"已关注%@天",model.intervalDay];
    if ([[NSString stringWithFormat:@"%@",model.userType]isEqualToString:@"3"]) {
        self.guanfang.hidden = NO;
        self.addBut.hidden = YES;
    }else {
        self.guanfang.hidden = YES;
        self.addBut.hidden = NO;
    }
}
@end

